<?php

namespace App\Console\Commands\Tasks\Data;

use Illuminate\Console\Command;

//每天统计总金额 、分类汇总金额
class MallBuyStatistics extends Command
{
    //命令名
    protected $signature = 'task:mall_buy_stat';

    //命令描述
    protected $description = '每天统计总金额/分类汇总金额';

    // 业务处理
    public function handle()
    {
        $time = time();
        $startTime = date('Y-m-d', $time - 86400);
        $endTime = date('Y-m-d', $time);
        $startTime = strtotime($startTime);
        $endTime = strtotime($endTime);
        app('repo_mall_orders_history')->crontabMallBuyStat($startTime, $endTime);
    }
}
